package com.cskaoyan.mapper;

import com.cskaoyan.bean.MarketComment;
import com.cskaoyan.bean.MarketCommentExample;
import com.cskaoyan.bean.chenfeng.vo.CommentListVo;
import com.cskaoyan.bean.leihao.vo.DataDTO;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface MarketCommentMapper {
    long countByExample(MarketCommentExample example);

    int deleteByExample(MarketCommentExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketComment record);

    int insertSelective(MarketComment record);

    List<MarketComment> selectByExample(MarketCommentExample example);

    MarketComment selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketComment record, @Param("example") MarketCommentExample example);

    int updateByExample(@Param("record") MarketComment record, @Param("example") MarketCommentExample example);

    int updateByPrimaryKeySelective(MarketComment record);

    int updateByPrimaryKey(MarketComment record);

    // 查询带图片的指定商品的评论
    Integer selectCommentCountWithPicByValueIdAndType(@Param("valueId") Integer valueId, @Param("type") Integer type);

    // 查询指定商品的所有评论
    Integer selectAllCommentCountByValueIdAndType(@Param("valueId") Integer valueId, @Param("type") Integer type);

    // 查询指定商品的所有评论信息
    List<CommentListVo> selectCommentHasPicByValueIdAndTypeWithPage(@Param("valueId") Integer valueId, @Param("type") Integer type);

    ArrayList<DataDTO> selectByValueId(Integer id);


    List<CommentListVo> selectAllCommentByValueIdAndTypeWithPage(@Param("valueId") Integer valueId, @Param("type") Integer type);
}